import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitDataStruct = itf({
    payload: itf({
        brands: [itf(Object.assign({
            id: 'string',
            code: 'string',
            name: 'string',
        }))]
    })
});

const content = {
    id: 'string',
    dealerCode: 'string',
    dealerName: 'string',
    partContractInvoiceCode: 'string? | null',
    invoicedDate: 'datetime? | null',
    shipmentType: 'number? | null',
    paymentType: 'number? | null',
    priceTerms: 'number? | null',
    invoiceAmount: 'number? | null',
    status: 'number? | null',
    rowVersion: 'string? | null',
    options: ['string? | null']
};

export const List = itf({
    payload: itf({
        content: [itf(Object.assign(content))]
    })
});

export const Detail = itf({
    payload: itf({
        id: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        partContractInvoiceCode: 'string? | null',
        details: [
            itf({
                partCode: 'string',
                partName: 'string',
            })
        ]
    })
});

export const ShipmentConfirmList = itf({
    payload: itf({
        content: [itf(Object.assign({
            id: 'string',
            code: 'string? | null',
            dealerCode: 'string? | null',
            dealerName: 'string? | null'
        }))],
    })
});
